clear
set matsize 10000
set mem 200m
program drop _all
scalar drop _all
set more off

cd ""
use "bennion_nickerson_ovr.replication.dta", clear

*** Table 1
tab school prev_reg, row
tab school treatment if prev_reg==0

keep if prev_reg==0
*** Table 2
* Pooled Estimates
xtreg registered online download, i(schnum) fe
outreg2 using table2.xls, excel ctitle("Pooled") nopa noas replace
* School by school
forvalues i=1(1)25 {
di "School #`i'"
reg registered online download if schnum==`i'
outreg2 using table2.xls, excel ctitle("Sch #`i'") nopa noas append
}

*** Table 3
* Pooled 
xtreg voted online download, i(schnum) fe
outreg2 using table3.xls, excel ctitle("Pooled") nopa noas replace
* School by school
forvalues i=1(1)25 {
di "School #`i'"
reg voted online download if schnum==`i'
outreg2 using table3.xls, excel ctitle("Sch #`i'") nopa noas append
}



*Table C1
log using "TABLEC1.log", replace
tab schnum treatment
bysort treatment: tabstat age instate, by(schnum)
log close




